﻿<UserControl x:Class="SLLoggingClient.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:Slf="clr-namespace:Slf;assembly=SLF.Silverlight" 
    mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480">
  <Grid x:Name="LayoutRoot">
        <StackPanel Orientation="Vertical" HorizontalAlignment="Center">
            
            <TextBlock Margin="0,50,0,0" TextWrapping="Wrap" VerticalAlignment="Stretch" FontSize="14" Width="400">
                <Run Text="This sample logs to a WCF service using SLF. For that, we created a simple" />
                <Run Text="ServiceClientLogger class which is part of the Silverlight sample." />
                <Run Text="On the service side, SLF is used too by the WCF service that is invoked by ServiceClientLogger:" />
                <Run Text="The service just forwards the received logging instruction to SLF, which is also running on the service." />
                <LineBreak />
                <LineBreak />
                <Run FontWeight="Bold" Text="How to use the sample:" />
                <LineBreak />
                <LineBreak />
                <Run Text="Just enter some text into the TextBox below, and log the message to SLF by pressing" />
                <Run Text="the 'Log!' button. This will log to the WCF service." />
                <LineBreak />
                <Run Text="To query all logged items, press the second button, which will retrieve all items from" />
                <Run Text="the WCF service." />
            </TextBlock>
                       
            
            <TextBox x:Name="txtMessage" Margin="0,20,0,0" AcceptsReturn="True" Height="50" Width="300" />
            <Button Click="LogInfo" Margin="0,20,0,0" Width="100" Height="24" HorizontalAlignment="Center"  VerticalAlignment="Center" Content="Log!" />
            
            <Button Click="GetItems" Margin="0,50,0,0" Content="Get Logged Items From Service" Width="300" />
            <ListBox x:Name="logViewer" Margin="0,50,0,0" MinHeight="50">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="{Binding Path=Timestamp}" />
                            <TextBlock Text=" - Logged entry (" />
                            <TextBlock Text="{Binding Path=LogLevel}" FontWeight="Bold" />
                            <TextBlock Text="): " />
                            <TextBlock Text="{Binding Path=Message}" />
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
            
        </StackPanel>
    </Grid>
</UserControl>
